﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Command
{
    class Program
    {
        static void Main(string[] args)
        {
            //Command cmd = new ConcreteCommand(new Receiver());
            //Invoker invoker = new Invoker();
            //invoker.SetCommand(cmd);
            //invoker.ExecuteCommand();
            
            //cmd.Execute();

            Console.Read();
        }
    }

    //abstract class Command
    //{
    //    protected Receiver receiver;
    //    public Command(Receiver receiver)
    //    {
    //        this.receiver = receiver;
    //    }
    //    public abstract void Execute();
    //}

    //class ConcreteCommand:Command
    //{
    //    public ConcreteCommand(Receiver receiver) : base(receiver) { }
    //    public override void Execute()
    //    {
    //        this.receiver.Action();
    //    }
    //}

    //class Receiver
    //{
    //    public void Action()
    //    {
    //        Console.WriteLine("Called {0}.Action()", this.GetType().Name);
    //    }
    //}

    //class Invoker
    //{
    //    private Command _command;
    //    public void SetCommand(Command command)
    //    {
    //        this._command = command;
    //    }

    //    public void ExecuteCommand()
    //    {
    //        _command.Execute();
    //    }
    //}

    abstract class Command
    {
        public abstract void Execute();
        public abstract void UnExecute();
    }


}
